public class ArrayErrorDemo {
    public static void main (String[] args) {
        String[] bookNames = {"java编程","python入门"};
        double[] prices = new double[3];
        prices[0] = 59.9;
        prices[1] = 69.9;
        prices[2] = 49.9;

        for (int i=0; i < bookNames.length;i++) {
            System.out.println(bookNames[i]+":" + prices[i] + "元");
        }
        double total = 0;
        for (int i = 0;i < prices.length; i++) {
            total +=prices[i];
        }
        System.out.println("总价：" + total + "元");
    }
}
